package com.hs.server.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hs.server.domain.VehZnshinfo;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface VehZnshinfoMapper extends BaseMapper<VehZnshinfo> {
    @Select("SELECT COUNT(czzt)AS noOperationNum FROM veh_znshinfo WHERE czzt=0 AND shlb=0")
    int SelectChayanNoOperationNum();

    @Select("SELECT COUNT(czzt)AS noOperationNum FROM veh_znshinfo WHERE czzt=0 AND shlb=0")
    int SelectJianyanNoOperationNum();

    @Select("SELECT lsh FROM veh_znshinfo WHERE shzt='1' AND czzt='0' ORDER BY cjsj LIMIT 1")
    String getLshWithPassNoOperating();

    @Update("UPDATE veh_znshinfo SET czzt='1' WHERE LSH = #{lsh}")
    int UpdateOperating(String lsh);

    @Update("UPDATE veh_znshinfo SET yczt='0' WHERE yczt = '1'")// and to_days(sqshsj) = to_days(now())
    int resetYcdata();

}
